<!-- $Id: brand_info.htm 14216 2008-03-10 02:27:21Z testyang $ -->
{include file="pageheader.htm"}
{insert_scripts files='../js/region.js,../js/utils.js,../js/position.js'}
<script type="text/javascript">
  region.isAdmin = true;
  {literal}
  onload = function() {
    if (!document.all)
    {
      document.forms['theForm'].reset();
    }
  }
  {/literal}
</script>
<div class="main-div">
<form method="post" action="brand.php" name="theForm" enctype="multipart/form-data" onsubmit="return validate()">
<table cellspacing="1" cellpadding="3" width="100%">
  <tr>
    <td class="label">{$lang.brand_name}</td>
    <td><input type="text" name="brand_name" maxlength="60" value="{$brand.brand_name}" />{$lang.require_field}</td>
  </tr>
  <tr>
    <td class="label">{$lang.site_url}</td>
    <td><input type="text" name="site_url" maxlength="60" size="40" value="{$brand.site_url}" /></td>
  </tr>
  <tr>
    <td class="label">{$lang.country_province}:</td>
    <td colspan="3" bgcolor="#ffffff">
    <select name="country" id="selCountries_{$sn}" onchange="region.changed(this, 1, 'selProvinces_{$sn}')" style="border:1px solid #ccc;">
        <option value="0">{$lang.please_select}{$name_of_region[0]}</option>
        <!-- {foreach from=$country_list item=country} -->
        <option value="{$country.region_id}" {if $brand.country eq $country.region_id}selected{/if}>{$country.region_name}</option>
        <!-- {/foreach} -->
      </select>
      <select name="province" id="selProvinces_{$sn}" onchange="region.changed(this, 2, 'selCities_{$sn}')" style="border:1px solid #ccc;">
        <option value="0">{$lang.please_select}{$name_of_region[1]}</option>
        <!-- {foreach from=$province_list.$sn item=province} -->
        <option value="{$province.region_id}" {if $brand.province eq $province.region_id}selected{/if}>{$province.region_name}</option>
        <!-- {/foreach} -->
      </select>
      <select name="city" id="selCities_{$sn}" onchange="region.changed(this, 3, 'selDistricts_{$sn}')" style="border:1px solid #ccc;">
        <option value="0">{$lang.please_select}{$name_of_region[2]}</option>
        <!-- {foreach from=$city_list.$sn item=city} -->
        <option value="{$city.region_id}" {if $brand.city eq $city.region_id}selected{/if}>{$city.region_name}</option>
        <!-- {/foreach} -->
      </select>
      <select name="district" id="selDistricts_{$sn}" onchange="getSubAdddr_FromRegion(this, 4, 'selHotspots_{$sn}')" {if !$district_list.$sn}style="display:none"{/if} style="border:1px solid #ccc;">
        <option value="0">{$lang.please_select}{$name_of_region[3]}</option>
        <!-- {foreach from=$district_list.$sn item=district} -->
        <option value="{$district.region_id}" {if $brand.district eq $district.region_id}selected{/if}>{$district.region_name}</option>
        <!-- {/foreach} -->
      </select>
    {$lang.require_field} </td>
  </tr>
  <tr id="hotspot_region" >
    <td class="label">热点地区</td>
    <td>
        <select name="hotspot" id="selHotspots_{$sn}" style="border:1px solid #ccc;">
            <option value="0">{$lang.please_select}热点地区</option>
            {foreach from=$hotspot_list.$sn item=hotspot}
            <option value="{$hotspot.hotspot_type}-{$hotspot.region_id}" {if $brand.hotspot_region_id eq $hotspot.region_id}selected{/if}>{foreach from=$hotspots key=k item=hotspot_name} {if $k eq $brand.hotspot_type}{$hotspot_name}{/if}{/foreach}&nbsp;&nbsp;{$hotspot.region_name}</option>
            {/foreach}
          </select>
          {$lang.require_field}
    </td>
  </tr>
  <tr>
    <td class="label">{$lang.shop_address}</td>
    <td><input type="text" id="shop_address" name="shop_address" maxlength="60" size="40" value="{$brand.shop_address}" />{$lang.require_field}</td>
  </tr>
  <tr>
    <td class="label">{$lang.shop_mobile}</td>
    <td><input type="text" id="shop_mobile" name="shop_mobile" maxlength="60" size="40" value="{$brand.shop_mobile}" />{$lang.require_field}</td>
  </tr> 
  <tr>
    <td class="label">{$lang.shop_truth}</td>
    <td>
        <select id="shop_truth" name="shop_truth">
            <option value="0">{$lang.please_select}</option>
            <option value="1" {if $brand.shop_truth eq 1}selected{/if}>1</option>
            <option value="2" {if $brand.shop_truth eq 2}selected{/if}>2</option>
            <option value="3" {if $brand.shop_truth eq 3}selected{/if}>3</option>
            <option value="4" {if $brand.shop_truth eq 4}selected{/if}>4</option>
            <option value="5" {if $brand.shop_truth eq 5}selected{/if}>5</option>
        </select>
        {$lang.require_field}
    </td>
  </tr>
  <tr>
    <td class="label">{$lang.shop_attitude}</td>
    <td>
        <select id="shop_attitude" name="shop_attitude">
            <option value="0">{$lang.please_select}</option>
            <option value="1" {if $brand.shop_attitude eq 1}selected{/if}>1</option>
            <option value="2" {if $brand.shop_attitude eq 2}selected{/if}>2</option>
            <option value="3" {if $brand.shop_attitude eq 3}selected{/if}>3</option>
            <option value="4" {if $brand.shop_attitude eq 4}selected{/if}>4</option>
            <option value="5" {if $brand.shop_attitude eq 5}selected{/if}>5</option>
        </select>
        {$lang.require_field}
    </td>
  </tr>
  <tr>
    <td class="label">{$lang.shop_happiness}</td>
    <td>
        <select id="shop_happiness" name="shop_happiness">
            <option value="0">{$lang.please_select}</option>
            <option value="1" {if $brand.shop_happiness eq 1}selected{/if}>1</option>
            <option value="2" {if $brand.shop_happiness eq 2}selected{/if}>2</option>
            <option value="3" {if $brand.shop_happiness eq 3}selected{/if}>3</option>
            <option value="4" {if $brand.shop_happiness eq 4}selected{/if}>4</option>
            <option value="5" {if $brand.shop_happiness eq 5}selected{/if}>5</option>
        </select>
        {$lang.require_field}
    </td>
  </tr>
  <tr>
    <td class="label"><a href="javascript:showNotice('warn_brandlogo');" title="{$lang.form_notice}">
        <img src="images/notice.gif" width="16" height="16" border="0" alt="{$lang.form_notice}"></a>{$lang.brand_logo}</td>
    <td><input type="file" name="brand_logo" id="logo" size="45">{if $brand.brand_logo neq ""}<input type="button" value="{$lang.drop_brand_logo}" onclick="if (confirm('{$lang.confirm_drop_logo}'))location.href='brand.php?act=drop_logo&id={$brand.brand_id}'">{/if}
    <br /><span class="notice-span" {if $help_open}style="display:block" {else} style="display:none" {/if} id="warn_brandlogo">
    {if $brand.brand_logo eq ''}
    {$lang.up_brandlogo}
    {else}
    {$lang.warn_brandlogo}
    {/if}
    </span>
    </td>
  </tr>
  <tr>
    <td class="label">{$lang.brand_desc}</td>
    <td><textarea  name="brand_desc" cols="60" rows="4"  >{$brand.brand_desc}</textarea></td>
  </tr>
  <tr>
    <td class="label">{$lang.sort_order}</td>
    <td><input type="text" name="sort_order" maxlength="40" size="15" value="{$brand.sort_order}" /></td>
  </tr>
  <tr>
    <td class="label">{$lang.is_show}</td>
    <td><input type="radio" name="is_show" value="1" {if $brand.is_show eq 1}checked="checked"{/if} /> {$lang.yes}
        <input type="radio" name="is_show" value="0" {if $brand.is_show eq 0}checked="checked"{/if} /> {$lang.no}
        ({$lang.visibility_notes})
    </td>
  </tr>
  <tr>
    <td colspan="2" align="center"><br />
      <input type="submit" class="button" value="{$lang.button_submit}" />
      <input type="reset" class="button" value="{$lang.button_reset}" />
      <input type="hidden" name="act" value="{$form_action}" />
      <input type="hidden" name="old_brandname" value="{$brand.brand_name}" />
      <input type="hidden" name="id" value="{$brand.brand_id}" />
      <input type="hidden" name="old_brandlogo" value="{$brand.brand_logo}">
    </td>
  </tr>
</table>
</form>
</div>
{insert_scripts files="../js/utils.js,validator.js"}
{literal}
<script language="JavaScript">
<!--
document.forms['theForm'].elements['brand_name'].focus();
onload = function()
{
    // 开始检查订单
    startCheckOrder();
}
/**
 * 检查表单输入的数据
 */
function validate()
{
    validator = new Validator("theForm");
    validator.required("brand_name",  no_brandname);
    //validator.required("shop_address",  no_shop_address); 
    validator.isSelectedNull("shop_truth", no_shop_truth);
    validator.isSelectedNull("shop_attitude", no_shop_attitude);
    validator.isSelectedNull("shop_happiness", no_shop_happiness);
    validator.isNumber("sort_order", require_num, true);
    return validator.passed();
}
//-->
</script>
{/literal}
{include file="pagefooter.htm"}